/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package graphic;

import java.util.List;

import javax.swing.JLabel;
import javax.swing.JPanel;
import puntajes.Puntaje;

/**
 *
 * @author maru
 */
public class ScoresPanel extends JPanel {

    public ScoresPanel(List<Puntaje> list) {
        setLayout(null);

        JLabel name = new JLabel("NOMBRE");
        name.setBounds( 70, 10, 100, 30);
        add(name);

        JLabel puntaje = new JLabel("PUNTAJE");
        puntaje.setBounds( 250, 10, 100, 30);
        add(puntaje);

        JLabel[] nro = new JLabel[10];
        JLabel[] personN = new JLabel[10];
        JLabel[] personP = new JLabel[10];

        for(int j=1; j<=10 && j<=list.size() ;j++){
            nro[j-1] = new JLabel(j+"-");
            nro[j-1].setBounds( 20, 10 + 35*j, 40, 30);
            add(nro[j-1]);

            personN[j-1] = new JLabel((list.get(j-1)).getNombre());
            personN[j-1].setBounds( 70, 10 + 35*j, 150, 30);
            add(personN[j-1]);

            int p =(list.get(j-1)).getPuntaje();
            personP[j-1] = new JLabel(p+"");
            personP[j-1].setBounds( 250, 10 + 35*j, 100, 30);
            add(personP[j-1]);
        }
    }
}